package com.li.sqlparse.entity;

import java.util.Objects;

/**
 * sql 字段和表关系对象
 */
public class TableColumnLinkDto {

    private String fromTable;
    private String toTable;
    private String fromColumn;
    private String toColumn;

    public String getFromTable() {
        return fromTable;
    }

    public void setFromTable(String fromTable) {
        this.fromTable = fromTable;
    }

    public String getToTable() {
        return toTable;
    }

    public void setToTable(String toTable) {
        this.toTable = toTable;
    }

    public String getFromColumn() {
        return fromColumn;
    }

    public void setFromColumn(String fromColumn) {
        this.fromColumn = fromColumn;
    }

    public String getToColumn() {
        return toColumn;
    }

    public void setToColumn(String toColumn) {
        this.toColumn = toColumn;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TableColumnLinkDto that = (TableColumnLinkDto) o;
        return Objects.equals(fromTable, that.fromTable) && Objects.equals(toTable, that.toTable) && Objects.equals(fromColumn, that.fromColumn) && Objects.equals(toColumn, that.toColumn);
    }

    @Override
    public int hashCode() {
        return Objects.hash(fromTable, toTable, fromColumn, toColumn);
    }

    @Override
    public String toString() {
        return "TableColumnLinkDto{" +
                "fromTable='" + fromTable + '\'' +
                ", toTable='" + toTable + '\'' +
                ", fromColumn='" + fromColumn + '\'' +
                ", toColumn='" + toColumn + '\'' +
                '}';
    }
}